/*
 * Swarm.h
 *
 *  Created on: 6 mei 2013
 *      Author: Wietse
 */

#ifndef SWARM_H_
#define SWARM_H_

#include "Definitions.h"
#include "Quadcopter/Quadcopter.h"
#include "Crawler.h"
#include "Basestation.h"

#include <windows.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include <vector>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>


class Swarm
{
private:
	std::vector<Message>	messages;
	Quadcopter 				quadcopters[NUM_OF_QUADCOPTERS];
	Crawler					crawlers[NUM_OF_CRAWLERS];
	BaseStation				basestation;

	std::string				coverage_filename;
	double					coverage_timer;

	void 					clearFile();
	void 					outputCoverage();
	void 					outputTime(std::ofstream&);
	void					spawnQuadcopters();
	void					spawnCrawlers();
public:
	Swarm();
	virtual ~Swarm();

	std::vector<Message>* 	getMessages();
	void 					addMessage(Message);
	void 					removeMessage(Message * message);
	void 					update(double);
	void 					display();
	std::vector<Crawler *> 	senseCrawlers(Position *);

};

#endif /* SWARM_H_ */
